package fr.afcepf.atod16.groupe1.projet1.dto.catalogue;

import fr.afcepf.atod16.groupe1.projet1.dto.Dto;
import java.util.Date;
import java.util.List;

/**
 * Le DTO promo
 * @author cedric
 */
public class DtoPromo implements Dto {

    private Integer id;
    private Date dateDebut;
    private Date dateFin;
    private Integer remise;
    private List<DtoProduit> produits;

    public DtoPromo() {
    }

    public DtoPromo(Integer id, Date dateDebut, Date dateFin, Integer remise, List<DtoProduit> produits) {
        this.id = id;
        this.dateDebut = dateDebut;
        this.dateFin = dateFin;
        this.remise = remise;
        this.produits = produits;
    }

    @Override
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDateDebut() {
        return dateDebut;
    }

    public void setDateDebut(Date dateDebut) {
        this.dateDebut = dateDebut;
    }

    public Date getDateFin() {
        return dateFin;
    }

    public void setDateFin(Date dateFin) {
        this.dateFin = dateFin;
    }

    public Integer getRemise() {
        return remise;
    }

    public void setRemise(Integer remise) {
        this.remise = remise;
    }

    public List<DtoProduit> getProduits() {
        return produits;
    }

    public void setProduits(List<DtoProduit> produits) {
        this.produits = produits;
    }

    @Override
    public String toString() {
        return "DtoPromo{" + "id=" + id + ", dateDebut=" + dateDebut + ", dateFin=" + dateFin + ", remise=" + remise + '}';
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 67 * hash + (this.dateDebut != null ? this.dateDebut.hashCode() : 0);
        hash = 67 * hash + (this.dateFin != null ? this.dateFin.hashCode() : 0);
        hash = 67 * hash + (this.remise != null ? this.remise.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DtoPromo other = (DtoPromo) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if (this.dateDebut != other.dateDebut && (this.dateDebut == null || !this.dateDebut.equals(other.dateDebut))) {
            return false;
        }
        if (this.dateFin != other.dateFin && (this.dateFin == null || !this.dateFin.equals(other.dateFin))) {
            return false;
        }
        if (this.remise != other.remise && (this.remise == null || !this.remise.equals(other.remise))) {
            return false;
        }
        return true;
    }
}
